import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';

import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {NZ_I18N, zh_CN} from 'ng-zorro-antd/i18n';
import {registerLocaleData} from '@angular/common';
import zh from '@angular/common/locales/zh';
import {FormsModule} from '@angular/forms';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {NgZorroAntdModule} from "./ng-zorro-antd.module";
import {ErrorModalComponent} from "./services/http/error-modal/error-modal.component";
import {NullValueInterceptor} from "./services/http/NullValueInterceptor";
import {BarnPipeModule} from "./barn-pipe.module";
import {NotFoundPageComponent} from "./pages/others/not-found-page/not-found-page.component";
import {RouteReuseStrategy} from "@angular/router";
import {AppRoutingCache} from "./rootStrategy/app-routing-cache";

registerLocaleData(zh);

@NgModule({
  declarations: [
    AppComponent, ErrorModalComponent, NotFoundPageComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    NgZorroAntdModule,
    BarnPipeModule
  ],
  providers: [{provide: NZ_I18N, useValue: zh_CN}, {
    provide: HTTP_INTERCEPTORS,
    useClass: NullValueInterceptor,
    multi: true
  }, {provide: RouteReuseStrategy, useClass: AppRoutingCache}],
  bootstrap: [AppComponent]
})
export class AppModule {
}
